<script setup lang="ts">
import { NForm, NFormItem, NInputNumber } from "naive-ui";

import { defineProps } from "vue";
import { IObjectConfig, useConfigStore } from "@/plugins/store";

interface IProps {
  type: string;
}

const props = defineProps<IProps>();
const store = useConfigStore();
let s: IObjectConfig | null = null;
switch (props.type) {
  case "first":
    s = store.first;
    break;
  case "second":
    s = store.second;
    break;
}
</script>

<template>
  <NForm>
    <NFormItem label="x">
      <NInputNumber v-model:value="s.x" min="20" max="9999" step="0.1" />
    </NFormItem>
    <NFormItem label="y">
      <NInputNumber v-model:value="s.y" min="20" max="9999" step="0.1" />
    </NFormItem>
    <NFormItem label="角度">
      <NInputNumber
        v-model:value="s.direction"
        min="-180"
        max="180"
        step="0.01"
      />
    </NFormItem>
    <NFormItem label="速度">
      <NInputNumber v-model:value="s.speed" min="0" step="0.01" />
    </NFormItem>
  </NForm>
</template>
